/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package apresentacao;
import java.sql.*;
import java.sql.Connection;
import javax.swing.JOptionPane;

/**
 *
 * @author Fernanda
 */
public class JFrameHorario extends javax.swing.JFrame {

    /**
     * Creates new form JFrameHorario
     */
    public JFrameHorario() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jTextFieldNomeAtualizar = new javax.swing.JTextField();
        jTextFieldNovoNomeProfessor = new javax.swing.JTextField();
        jTextFieldNovaAulaSegunda = new javax.swing.JTextField();
        jTextFieldNovoHorarioSegunda = new javax.swing.JTextField();
        jTextFieldNovaSalaSegunda = new javax.swing.JTextField();
        jTextFieldNovaAulaTerca = new javax.swing.JTextField();
        jTextFieldNovoHorarioTerca = new javax.swing.JTextField();
        jTextFieldNovaSalaTerca = new javax.swing.JTextField();
        jTextFieldNovaAulaQuarta = new javax.swing.JTextField();
        jTextFieldNovoHorarioQuarta = new javax.swing.JTextField();
        jTextFieldNovaSalaQuarta = new javax.swing.JTextField();
        jTextFieldNovaAulaQuinta = new javax.swing.JTextField();
        jTextFieldNovoHorarioQuinta = new javax.swing.JTextField();
        jTextFieldNovaSalaQuinta = new javax.swing.JTextField();
        jTextFieldNovaAulaSexta = new javax.swing.JTextField();
        jTextFieldNovoHorarioSexta = new javax.swing.JTextField();
        jTextFieldNovaSalaSexta = new javax.swing.JTextField();
        jTextFieldNovaAulaSabado = new javax.swing.JTextField();
        jTextFieldNovoHorarioSabado = new javax.swing.JTextField();
        jTextFieldNovaSalaSabado = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        jTextFieldNomeDisciplina = new javax.swing.JTextField();
        jTextFieldNomeProfessor = new javax.swing.JTextField();
        jTextFieldAulaSegunda = new javax.swing.JTextField();
        jTextFieldHorarioSegunda = new javax.swing.JTextField();
        jTextFieldSalaSegunda = new javax.swing.JTextField();
        jTextFieldAulaTerca = new javax.swing.JTextField();
        jTextFieldHorarioTerca = new javax.swing.JTextField();
        jTextFieldSalaTerca = new javax.swing.JTextField();
        jTextFieldAulaQuarta = new javax.swing.JTextField();
        jTextFieldHorarioQuarta = new javax.swing.JTextField();
        jTextFieldSalaQuarta = new javax.swing.JTextField();
        jTextFieldAulaQuinta = new javax.swing.JTextField();
        jTextFieldHorarioQuinta = new javax.swing.JTextField();
        jTextFieldSalaQuinta = new javax.swing.JTextField();
        jTextFieldAulaSexta = new javax.swing.JTextField();
        jTextFieldHorarioSexta = new javax.swing.JTextField();
        jTextFieldSalaSexta = new javax.swing.JTextField();
        jTextFieldAulaSabado = new javax.swing.JTextField();
        jTextFieldHorarioSabado = new javax.swing.JTextField();
        jLabel61 = new javax.swing.JLabel();
        jTextFieldSalaSabado = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jTextFieldNomeRemocao = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jButton4 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Alterar Disciplina"));

        jLabel1.setText("Nome");

        jLabel2.setText("Nome do professor");

        jLabel3.setText("Aula na segunda");

        jLabel4.setText("Horário da aula");

        jLabel5.setText("Sala");

        jLabel6.setText("Aula na terça");

        jLabel7.setText("Horário da aula");

        jLabel8.setText("Sala");

        jLabel9.setText("Aula na quarta");

        jLabel10.setText("Horário da aula");

        jLabel11.setText("Sala");

        jLabel12.setText("Aula na quinta");

        jLabel13.setText("Horário da aula");

        jLabel14.setText("Sala");

        jLabel15.setText("Aula na sexta");

        jLabel16.setText("Horário da aula");

        jLabel17.setText("Sala");

        jLabel18.setText("Aula na sábado");

        jLabel19.setText("Horário da aula");

        jTextFieldNomeAtualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldNomeAtualizarActionPerformed(evt);
            }
        });

        jLabel62.setText("Sala");

        jButton2.setText("Alterar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldNovaSalaSegunda, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(34, 34, 34)
                        .addComponent(jTextFieldNovaAulaTerca))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldNovoHorarioTerca))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldNovaSalaTerca))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addGap(27, 27, 27)
                        .addComponent(jTextFieldNovaAulaQuarta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldNovoHorarioQuarta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldNovaSalaQuarta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addGap(29, 29, 29)
                        .addComponent(jTextFieldNovaAulaQuinta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldNovoHorarioQuinta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldNovaSalaQuinta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addGap(32, 32, 32)
                        .addComponent(jTextFieldNovaAulaSexta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldNovoHorarioSexta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldNovaSalaSexta))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addGap(24, 24, 24)
                        .addComponent(jTextFieldNovaAulaSabado))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextFieldNomeAtualizar, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                            .addComponent(jTextFieldNovoNomeProfessor))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldNovaAulaSegunda))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldNovoHorarioSegunda))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel62)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton2)))
                        .addGap(3, 3, 3)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldNovaSalaSabado, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextFieldNovoHorarioSabado))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldNomeAtualizar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextFieldNovoNomeProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextFieldNovaAulaSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextFieldNovoHorarioSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jTextFieldNovaSalaSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTextFieldNovaAulaTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jTextFieldNovoHorarioTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jTextFieldNovaSalaTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jTextFieldNovaAulaQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jTextFieldNovoHorarioQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTextFieldNovaSalaQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jTextFieldNovaAulaQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jTextFieldNovoHorarioQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jTextFieldNovaSalaQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jTextFieldNovaAulaSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jTextFieldNovoHorarioSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jTextFieldNovaSalaSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jTextFieldNovaAulaSabado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel19)
                    .addComponent(jTextFieldNovoHorarioSabado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel62)
                        .addComponent(jTextFieldNovaSalaSabado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jButton2)))
                .addGap(51, 51, 51))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Inserir Disciplina"));

        jLabel41.setText("Nome");

        jLabel42.setText("Nome do professor");

        jLabel43.setText("Aula na segunda");

        jLabel44.setText("Horário da aula");

        jLabel45.setText("Sala");

        jLabel46.setText("Aula na terça");

        jLabel47.setText("Horário da aula");

        jLabel48.setText("Sala");

        jLabel49.setText("Aula na quarta");

        jLabel50.setText("Horário da aula");

        jLabel51.setText("Sala");

        jLabel52.setText("Aula na quinta");

        jLabel53.setText("Horário da aula");

        jLabel54.setText("Sala");

        jLabel55.setText("Aula na sexta");

        jLabel56.setText("Horário da aula");

        jLabel57.setText("Sala");

        jLabel58.setText("Aula na sábado");

        jLabel59.setText("Horário da aula");

        jTextFieldNomeDisciplina.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldNomeDisciplinaActionPerformed(evt);
            }
        });

        jLabel61.setText("Sala");

        jButton1.setText("Inserir");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel45)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldSalaSegunda, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel46)
                        .addGap(34, 34, 34)
                        .addComponent(jTextFieldAulaTerca))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel47)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioTerca))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel48)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldSalaTerca))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel49)
                        .addGap(27, 27, 27)
                        .addComponent(jTextFieldAulaQuarta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel50)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioQuarta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel51)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldSalaQuarta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel52)
                        .addGap(29, 29, 29)
                        .addComponent(jTextFieldAulaQuinta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel53)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioQuinta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel54)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldSalaQuinta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel55)
                        .addGap(32, 32, 32)
                        .addComponent(jTextFieldAulaSexta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel56)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioSexta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel57)
                        .addGap(77, 77, 77)
                        .addComponent(jTextFieldSalaSexta))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel58)
                        .addGap(24, 24, 24)
                        .addComponent(jTextFieldAulaSabado))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel59)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioSabado))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel42)
                            .addComponent(jLabel41))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextFieldNomeDisciplina, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                            .addComponent(jTextFieldNomeProfessor)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel43)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldAulaSegunda))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel44)
                        .addGap(25, 25, 25)
                        .addComponent(jTextFieldHorarioSegunda))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel61)
                        .addGap(8, 8, 8)
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldSalaSabado)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(29, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel41)
                    .addComponent(jTextFieldNomeDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel42)
                    .addComponent(jTextFieldNomeProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel43)
                    .addComponent(jTextFieldAulaSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel44)
                    .addComponent(jTextFieldHorarioSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel45)
                    .addComponent(jTextFieldSalaSegunda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel46)
                    .addComponent(jTextFieldAulaTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel47)
                    .addComponent(jTextFieldHorarioTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel48)
                    .addComponent(jTextFieldSalaTerca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel49)
                    .addComponent(jTextFieldAulaQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel50)
                    .addComponent(jTextFieldHorarioQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel51)
                    .addComponent(jTextFieldSalaQuarta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel52)
                    .addComponent(jTextFieldAulaQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel53)
                    .addComponent(jTextFieldHorarioQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel54)
                    .addComponent(jTextFieldSalaQuinta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel55)
                    .addComponent(jTextFieldAulaSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel56)
                    .addComponent(jTextFieldHorarioSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel57)
                    .addComponent(jTextFieldSalaSexta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel58)
                    .addComponent(jTextFieldAulaSabado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel59)
                    .addComponent(jTextFieldHorarioSabado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel61)
                    .addComponent(jTextFieldSalaSabado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addGap(54, 54, 54))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Remover Disciplina"));

        jLabel20.setText("Nome");

        jTextFieldNomeRemocao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldNomeRemocaoActionPerformed(evt);
            }
        });

        jButton3.setText("Remover");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldNomeRemocao, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jButton3)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jTextFieldNomeRemocao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3)
                .addContainerGap(100, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Visualizar Disciplina"));

        jButton4.setText("Visualizar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jButton4)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jButton4)
                .addGap(0, 74, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(14, 14, 14))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldNomeAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldNomeAtualizarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldNomeAtualizarActionPerformed

    private void jTextFieldNomeDisciplinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldNomeDisciplinaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldNomeDisciplinaActionPerformed

    private void jTextFieldNomeRemocaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldNomeRemocaoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldNomeRemocaoActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        try {
    //Registra JDBC driver
    Class.forName("com.mysql.jdbc.Driver");
 
    //Abrindo a conexão: ATENÇÃO OS DOIS PARÂMETROS VAZIOS("") SÃO USUÁRIO E SENHA, RESPECTIVAMENTE.
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/unifei?zeroDateTimeBehavior=convertToNull", "root", "root");
     if(!"".equals(this.jTextFieldNomeDisciplina.getText())){ 
    //Executa a query de inserção
    java.sql.Statement st = conn.createStatement();
    st.executeUpdate("INSERT INTO horario (NomeDisciplina,NomeProfessor,AulaSegunda,HorariosSegunda,SalaSegunda,AulaTerca,HorariosTerca,SalaTerca,AulaQuarta,HorariosQuarta,SalaQuarta,AulaQuinta,HorariosQuinta,SalaQuinta,AulaSexta,HorariosSexta,SalaSexta,AulaSabado,HorariosSabado,SalaSabado) VALUES ("
            + this.jTextFieldNomeDisciplina.getText() + ",'"
            + this.jTextFieldNomeProfessor.getText() + "','"
            + this.jTextFieldAulaSegunda.getText() + "','"
            + this.jTextFieldHorarioSegunda.getText() + "','"
            + this.jTextFieldSalaSegunda.getText() + "','"
            
            + this.jTextFieldAulaTerca.getText() + "','"
            + this.jTextFieldHorarioTerca.getText() + "','"
            + this.jTextFieldSalaTerca.getText() + "','"
            + this.jTextFieldAulaQuarta.getText() + "','"
            + this.jTextFieldHorarioQuarta.getText() + "','"
            + this.jTextFieldSalaQuarta.getText() + "','"
            + this.jTextFieldAulaQuinta.getText() + "','"
            + this.jTextFieldHorarioQuinta.getText() + "','"
            + this.jTextFieldSalaQuinta.getText() + "','"
            + this.jTextFieldAulaSexta.getText() + "','"
            + this.jTextFieldHorarioSexta.getText() + "','"
            + this.jTextFieldSalaSexta.getText() + "','"
            + this.jTextFieldAulaSabado.getText() + "','"
            + this.jTextFieldHorarioSabado.getText() + "','"
            + this.jTextFieldSalaSabado.getText() + "')");
 
    JOptionPane.showMessageDialog(rootPane, "Horario inserido");}
     else{
         JOptionPane.showMessageDialog(null, "Digite um Nome de Disciplina valido","Erro",JOptionPane.ERROR_MESSAGE );
     }
} catch (SQLException | ClassNotFoundException e) {
    JOptionPane.showMessageDialog(rootPane, e);
}//Fim try
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
         try {
    //Registra JDBC driver
    Class.forName("com.mysql.jdbc.Driver");
 
    //Abrindo a conexão: ATENÇÃO OS DOIS PARÂMETROS VAZIOS("") SÃO USUÁRIO E SENHA, RESPECTIVAMENTE.
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/unifei?zeroDateTimeBehavior=convertToNull", "root", "root");
     if(!"".equals(this.jTextFieldNomeAtualizar.getText())){
    //Executa a query de inserção
    java.sql.Statement st = conn.createStatement();
    st.executeUpdate("Update horario SET NomeProfessor='"
            + this.jTextFieldNovoNomeProfessor.getText() + "',AulaSegunda='"
            + this.jTextFieldNovaAulaSegunda.getText() + "',HorariosSegunda='"
            + this.jTextFieldNovoHorarioSegunda.getText() + "',SalaSegunda='"
            + this.jTextFieldNovaSalaSegunda.getText() + "',AulaTerca='"
            
            + this.jTextFieldNovaAulaTerca.getText() + "',HorariosTerca='"
            + this.jTextFieldNovoHorarioTerca.getText() + "',SalaTerca='"
            + this.jTextFieldNovaSalaTerca.getText() + "',AulaQuarta='"
            + this.jTextFieldNovaAulaQuarta.getText() + "',HorariosQuarta='"
            + this.jTextFieldNovoHorarioQuarta.getText() + "',SalaQuarta='"
            + this.jTextFieldNovaSalaQuarta.getText() + "',AulaQuinta='"
            + this.jTextFieldNovaAulaQuinta.getText() + "',HorariosQuinta='"
            + this.jTextFieldNovoHorarioQuinta.getText() + "',SalaQuinta='"
            + this.jTextFieldNovaSalaQuinta.getText() + "',AulaSexta='"
            + this.jTextFieldNovaAulaSexta.getText() + "',HorariosSexta='"
            + this.jTextFieldNovoHorarioSexta.getText() + "',SalaSexta='"
            + this.jTextFieldNovaSalaSexta.getText() + "',AulaSabado='"
            + this.jTextFieldNovaAulaSabado.getText() + "',HorariosSabado='"
            + this.jTextFieldNovoHorarioSabado.getText() + "',SalaSabado='"
            + this.jTextFieldNovaSalaSabado.getText() 
            + "' WHERE NomeDisciplina='" + this.jTextFieldNomeAtualizar.getText()+"'");
 
    JOptionPane.showMessageDialog(rootPane, "Horario atualizado");}
     else{
         JOptionPane.showMessageDialog(null, "Digite um Nome de Disciplina valido","Erro",JOptionPane.ERROR_MESSAGE );
     }
} catch (SQLException | ClassNotFoundException e) {
    JOptionPane.showMessageDialog(rootPane, e);
}//Fim try
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        try {
    //Registra JDBC driver
    Class.forName("com.mysql.jdbc.Driver");
 
    //Abrindo a conexão
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/Unifei?zeroDateTimeBehavior=convertToNull", "root", "root");
     if(!"".equals(this.jTextFieldNomeRemocao.getText())){
    //Executa a query de exclusão
    java.sql.Statement st = conn.createStatement();
    st.executeUpdate("DELETE FROM Horario WHERE NomeDisciplina='" + this.jTextFieldNomeRemocao.getText() + "'");
    JOptionPane.showMessageDialog(rootPane, "Horario excluído");}
     else{
         JOptionPane.showMessageDialog(null, "Digite um Nome de Disciplina valido","Erro",JOptionPane.ERROR_MESSAGE );
     }
} catch (SQLException | ClassNotFoundException e) {
    JOptionPane.showMessageDialog(rootPane, e);
}//Fim try
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        try {
    //Registra JDBC driver
    Class.forName("com.mysql.jdbc.Driver");
 
    //Abrindo a conexão
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/Unifei?zeroDateTimeBehavior=convertToNull", "root", "root");
 
    //Executa a query de seleção
    java.sql.Statement st = conn.createStatement();
    st.executeQuery("select * from horario");
    ResultSet rs = st.getResultSet();
    String mensagem;
    mensagem="";
    //Lista os alunos no console
    while (rs.next()) {
        mensagem=mensagem+"Nome Disciplina:"+rs.getString("NomeDisciplina")+" "+"NomeProfessor:"+rs.getString("NomeProfessor")+"\n"+
        "AulaSegunda:"+rs.getString("AulaSegunda")+" "+ 
        "HorariosSegunda:"+rs.getString("HorariosSegunda")+" "+ 
        "SalaSegunda:"+rs.getString("SalaSegunda")+"\n"+
        "AulaTerca:"+rs.getString("AulaTerca")+" "+ 
        "HorariosTerca:"+rs.getString("HorariosTerca")+" "+ 
        "SalaTerca:"+rs.getString("SalaTerca")+"\n"+
        "AulaQuarta:"+rs.getString("AulaQuarta")+ " "+
        "HorariosQuarta:"+rs.getString("HorariosQuarta")+" "+ 
        "SalaSQuarta:"+rs.getString("SalaQuarta")+"\n"+
        "AulaQuinta:"+rs.getString("AulaQuinta")+ " "+
        "HorariosQuinta:"+rs.getString("HorariosQuinta")+ " "+
        "SalaQuinta:"+rs.getString("SalaQuinta")+"\n"+        
        "AulaSexta:"+rs.getString("AulaSexta")+ " "+
        "HorariosSexta:"+rs.getString("HorariosSexta")+ " "+
        "SalaSexta:"+rs.getString("SalaSexta")+"\n"+
        "AulaSabado:"+rs.getString("AulaSabado")+ " "+
        "HorariosSabado:"+rs.getString("HorariosSabado")+" "+ 
        "SalaSabado:"+rs.getString("SalaSabado")+"\n";        
    }
    JOptionPane.showMessageDialog(null, mensagem,"Horarios",JOptionPane.PLAIN_MESSAGE );
 
    //Lista os alunos no console
    
} catch (SQLException | ClassNotFoundException e) {
    JOptionPane.showMessageDialog(rootPane, e);
}//Fim try
    }//GEN-LAST:event_jButton4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JFrameHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JFrameHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JFrameHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JFrameHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrameHorario().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JTextField jTextFieldAulaQuarta;
    private javax.swing.JTextField jTextFieldAulaQuinta;
    private javax.swing.JTextField jTextFieldAulaSabado;
    private javax.swing.JTextField jTextFieldAulaSegunda;
    private javax.swing.JTextField jTextFieldAulaSexta;
    private javax.swing.JTextField jTextFieldAulaTerca;
    private javax.swing.JTextField jTextFieldHorarioQuarta;
    private javax.swing.JTextField jTextFieldHorarioQuinta;
    private javax.swing.JTextField jTextFieldHorarioSabado;
    private javax.swing.JTextField jTextFieldHorarioSegunda;
    private javax.swing.JTextField jTextFieldHorarioSexta;
    private javax.swing.JTextField jTextFieldHorarioTerca;
    private javax.swing.JTextField jTextFieldNomeAtualizar;
    private javax.swing.JTextField jTextFieldNomeDisciplina;
    private javax.swing.JTextField jTextFieldNomeProfessor;
    private javax.swing.JTextField jTextFieldNomeRemocao;
    private javax.swing.JTextField jTextFieldNovaAulaQuarta;
    private javax.swing.JTextField jTextFieldNovaAulaQuinta;
    private javax.swing.JTextField jTextFieldNovaAulaSabado;
    private javax.swing.JTextField jTextFieldNovaAulaSegunda;
    private javax.swing.JTextField jTextFieldNovaAulaSexta;
    private javax.swing.JTextField jTextFieldNovaAulaTerca;
    private javax.swing.JTextField jTextFieldNovaSalaQuarta;
    private javax.swing.JTextField jTextFieldNovaSalaQuinta;
    private javax.swing.JTextField jTextFieldNovaSalaSabado;
    private javax.swing.JTextField jTextFieldNovaSalaSegunda;
    private javax.swing.JTextField jTextFieldNovaSalaSexta;
    private javax.swing.JTextField jTextFieldNovaSalaTerca;
    private javax.swing.JTextField jTextFieldNovoHorarioQuarta;
    private javax.swing.JTextField jTextFieldNovoHorarioQuinta;
    private javax.swing.JTextField jTextFieldNovoHorarioSabado;
    private javax.swing.JTextField jTextFieldNovoHorarioSegunda;
    private javax.swing.JTextField jTextFieldNovoHorarioSexta;
    private javax.swing.JTextField jTextFieldNovoHorarioTerca;
    private javax.swing.JTextField jTextFieldNovoNomeProfessor;
    private javax.swing.JTextField jTextFieldSalaQuarta;
    private javax.swing.JTextField jTextFieldSalaQuinta;
    private javax.swing.JTextField jTextFieldSalaSabado;
    private javax.swing.JTextField jTextFieldSalaSegunda;
    private javax.swing.JTextField jTextFieldSalaSexta;
    private javax.swing.JTextField jTextFieldSalaTerca;
    // End of variables declaration//GEN-END:variables
}
